package com.hex.ds.hdrs.app.dao;

import com.hex.bigdata.hbda.base.BaseDao;
import com.hex.ds.hdrs.app.po.AppAdminRelationPo;
import com.hex.ds.hdrs.app.po.MenuPo;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Package com.hex.ds.hdrs.app.dao
 * @ClassName AppAdminRelationDao
 * @Description 应用与管理员关联表Dao接口
 * @Author yu liuyang
 * @Date 2023/4/16 10:32
 * @Version v1.0
 **/
@Repository
public class AppAdminRelationDao extends BaseDao {

    /**
     * @Method queryList <br>
     * @Param [appAdminRelation] <br>
     * @Return java.util.List<com.hex.ds.hdrs.app.po.AppAdminRelation> <br>
     * @Description 查询用户与管理员关联列表 <br>
     * @Author yu liuyang <br>
     * @Date 2023/4/18 17:53 <br>
     * @Version V1.0 <br>
     */
    public List<AppAdminRelationPo> queryList(AppAdminRelationPo appAdminRelationPo) {
        return this.selectList(AppAdminRelationPo.class, "com.hex.ds.hdrs.app.dao.AppAdminRelationDao.queryList", appAdminRelationPo);
    }

    /**
     * @Method add <br>
     * @Param [appAdminRelation] <br>
     * @Return int <br>
     * @Description 添加应用与管理员关联 <br>
     * @Author yu liuyang <br>
     * @Date 2023/4/18 16:08 <br>
     * @Version V1.0 <br>
     */
    public int insert(AppAdminRelationPo appAdminRelationPo) {
        return this.insert("com.hex.ds.hdrs.app.dao.AppAdminRelationDao.insert", appAdminRelationPo);
    }

    /**
     * @Method delete <br>
     * @Param [appAdminRelation] <br>
     * @Return int <br>
     * @Description 根据应用编码或管理员编码删除应用与管理员关联 <br>
     * @Author yu liuyang <br>
     * @Date 2023/4/16 10:35 <br>
     * @Version V1.0 <br>
     */
    public int delete(AppAdminRelationPo appAdminRelationPo) {
        return this.delete("com.hex.ds.hdrs.app.dao.AppAdminRelationDao.delete", appAdminRelationPo);
    }

    public List<MenuPo> queryPermissionByRoleId(String roleId){
        return this.selectList(MenuPo.class, "com.hex.ds.hdrs.app.dao.AppAdminRelationDao.queryPermissionByRoleId", roleId);
    }
}